/**
 * There are code generation
 */
package com.neusoft.lohas.modules.ivm.entity.merchant;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.neusoft.lohas.common.persistence.IdEntity;

/**
 * 小店公告Entity
 * @author Jackie.Liu
 * @version 2014-10-30
 */
@Entity
@Table(name = "ivm_activity_Poster")
@DynamicInsert @DynamicUpdate
public class ActivityPoster extends IdEntity<ActivityPoster> {

	private static final long serialVersionUID = 1L;
	private String name; 	// 名称
	private String content;		//小店公告内容（富文本）
	private String brief; //截取的公告纯文本内容
	private Merchant merchant; //商户信息
	private String picUrl;	//海报图片地址
	private int openState;	//是否开放：1是，0否

	public ActivityPoster() {
		super();
	}

	public ActivityPoster(String id){
		this();
		this.id = id;
	}
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	//@Length(min=1, max=1000)
	public String getContent() {
		return content;
	}
	
	public void setContent(String content) {
		this.content = content;
	}

	public String getBrief() {
		return brief;
	}

	public void setBrief(String brief) {
		this.brief = brief;
	}

	@ManyToOne
	@JoinColumn(name="merchant_id")
	@NotFound(action = NotFoundAction.IGNORE)
	@JsonIgnore
	@NotNull(message="所属商户信息不能为空")
	public Merchant getMerchant() {
		return merchant;
	}

	public void setMerchant(Merchant merchant) {
		this.merchant = merchant;
	}

	public String getPicUrl() {
		return picUrl;
	}

	public void setPicUrl(String picUrl) {
		this.picUrl = picUrl;
	}

	public int getOpenState() {
		return openState;
	}

	public void setOpenState(int openState) {
		this.openState = openState;
	}
	
}


